import request from "../request"
import qs from "querystring"

const LIST_PATH = "users"
//用户渲染
function getList(params) {
    return request({
        url: LIST_PATH + "?" + qs.stringify(params),
        method: "get",
    })
}
//用户添加
function getUserAdd(params) {
    return request({
        url: LIST_PATH,
        method: "post",
        data: params
    })
}
//用户删除
function getUserDel(params) {
    return request({
        url: LIST_PATH + "/" + params,
        method: "delete",
    })
}
//用户编辑
function getUserEdit(params, obj) {
    return request({
        url: LIST_PATH + "/" + params,
        method: "put",
        data: obj
    })
}




function getSwitch(obj) {
    return request({
        url: LIST_PATH + '/' + obj.id + '/state/' + obj.mg_state,
        method: 'put'
    })
}

export { getList, getUserAdd, getUserDel, getUserEdit, getSwitch }